<?php
/**
 * Created by PhpStorm.
 * User: 13790
 * Date: 2018/3/21
 * Time: 16:00
 */

namespace app\common\validate;


use think\Validate;

class Admin extends Validate
{
    protected $reul=[
        'admin_user' => 'require|unique:admin,admin_user',
        'admin_pass' => 'require|max:25',
        'admin_password' => 'require|confirm:admin_pass',
        'admin_phone'    => 'require|length:11',
        'admin_emile'    => 'email|require',
        ];

    protected $message=[
        'admin_user.require'  =>'用户名不能为空',
        'damin_user.unique' =>'用户名已存在',
        'admin_pass.require'=> '密码不能为空',
        'admin_pass.max'  =>'密码长度不符',
        'admin_password.confirm' =>  '两次密码不一致',
        'admin_password.require' =>  '确认密码不能为空',
        'admin_phone.require' =>     '手机号不能为空',
        'admin_phone.length'  =>     '手机号有误',
        'admin_emile.email'   =>      '邮箱格式有误',
        'admin_emile.require' =>     '邮箱不能为空',
    ];
    protected $scent=[
      'add'=>['admin_user','admin_pass','admin_password','admin_phone','admin_emile'],
       'edit'=>['admin_user','admin_pass','admin_password','admin_phone','admin_emile'],
    ];
}